package com.white.algebra.dao;

import com.white.algebra.domain.Discuss;
import com.white.algebra.domain.Discussion;

import java.sql.SQLException;
import java.util.List;

public interface DiscussDao {
    List<Discussion> findAll(int startRecord, int size,String name) throws SQLException;

    List<Discuss> findAllDiscuss() throws SQLException;

    void insertDiscussion(Discussion discussion) throws SQLException;

    Discussion findDiscussionById(String id) throws SQLException;

    /**
     * 通过帖子id查找评论
     * @param id
     * @param startRecord
     * @param size
     * @return
     */
    List<Discuss> findDiscussByDiscussionId(String id, int startRecord, int size) throws SQLException;

    /**
     * 通过ID查找评论
     * @param id
     * @return
     */
    Discuss findDiscussById(String id) throws SQLException;

    int getDiscussionNum(String name) throws SQLException;

    int getDiscussNum(String id) throws SQLException;

    void updateThumbsUp(String mapKey, String mapValue) throws SQLException;

    void thumbsUp(String id, String fun);

    void insertDiscuss(Discuss discuss) throws SQLException;

    void viewDiscussion(String discussionId) throws SQLException;
}
